﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jenvin.Library.Utils.Encryption;

namespace Jenvin.Library.Utils.Encryption
{
    public static class EncryptionFactory
    {
        /// <summary>
        /// 创建对称Des 加密算法类
        /// IV如果不指定。根据Key计算来
        /// des的Key 8个ASCII 字符 。如果少于用空格补齐
        /// 多于自动截断
        /// </summary>
        /// <returns></returns>
        public static ISymEncryption CreateDES()
        {
            return new DESEncryption();
        }

        /// <summary>
        /// 创建对称3 Des 加密算法类
        /// IV如果不指定。根据Key计算来
        /// des的Key 至少8，至多24个ASCII 字符 。如果少于用空格补齐。多于自动截断
        /// </summary>
        /// <returns></returns>
        public static ISymEncryption CreateTripleDES()
        {
            return new TripleDESEncryption();
        }

        /// <summary>
        /// 非对称加密 Rsa
        /// 加密时无需指定IV
        /// </summary>
        /// <returns></returns>
        public static IAysmEncryption CreateRSA()
        {
            return new RSAEncryption();
        }
        /// <summary>
        /// 加密时，无需指定IV
        /// </summary>
        /// <returns></returns>
        public static ISymEncryption CreateCaesar()
        {
            return new CaesarEncryption();
        }

        public static ISymEncryption CreateAES()
        {
            return new AESEncryption();
        }


    }
}
